package com.amat0urheu.controller.adminController;


import com.amat0urheu.pojo.ReturnRes;
import com.amat0urheu.service.SystemService;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api")
public class SystemController {
    @Autowired
    SystemService systemService;

    @PreAuthorize("hasAuthority('ROLE_admin')")
    //    @PreAuthorize("hasAuthority('ROLE_admin')")
    @PostMapping("/cloud/saveInstruction")
    public ReturnRes updateOpenstack(@RequestParam(name = "Instruction") String sysTemUserInformation) {

        System.err.println(sysTemUserInformation);
        return    systemService.doSystemInformation(sysTemUserInformation);
    }
    @PreAuthorize("hasAuthority('ROLE_admin')")
@GetMapping("/cloud/getInstruction")
public ReturnRes getInstruction(){

        return  systemService.getInstruction();
}

}